package com.atguigu.gulimall.order.feign;

import com.atguigu.common.to.ware.FreightRespTo;
import com.atguigu.common.to.ware.WareSkuLockRequestTo;
import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("gulimall-ware")
public interface WareFeignService {

    @RequestMapping("/ware/waresku/hasstock")
    R hasSkuStock(@RequestBody List<Long> skuIds);

    @GetMapping("/ware/wareinfo/getFreight")
    R getFreight(@RequestParam("addrId") Long addrId);

    /**
     * 锁定订单库存
     *
     * @param to 订单锁定信息
     * @return R
     */
    @PostMapping("/ware/waresku/stock/lock")
    R lockSkuItem(@RequestBody WareSkuLockRequestTo to);
}
